import React from 'react';
import { SecondHeaderC, FormGroup } from '../../../../../comps';
//引入组件
import ZcReportInfo from './ZcReportInfo'; //1-资产
import TzReportInfo from './TzReportInfo'; //2-投资

class ReportInfo extends React.Component {
  constructor() {
    super();
    this.state = {};
  }
  componentDidMount() {
    this.props.onRef && this.props.onRef(this);
  }
  //此时是获取报表中的内容
  getInfo = () => {
    const { activeKey } = this.props;
    if (activeKey == '1') {
      return this.zc.getInfo;
    } else {
      return this.tz.getInfo;
    }
  };
  render() {
    const { activeKey, disableStatus, reportInfo, baseBaseInfoChangeReport, onBaseInfoChange } = this.props;
    return (
      <div>
        <SecondHeaderC title='监管报表信息'></SecondHeaderC>
        {activeKey == '1' ? (
          <>
            <ZcReportInfo
              reportInfo={reportInfo}
              disableStatus={disableStatus}
              onRef={(ref) => (this.zc = ref)}
              baseBaseInfoChangeReport={baseBaseInfoChangeReport}
              onBaseInfoChange={this.props?.onBaseInfoChange && this.props?.onBaseInfoChange}
              changeYQSYL={this.props?.changeYQSYL && this.props?.changeYQSYL}
            ></ZcReportInfo>
          </>
        ) : (
          <TzReportInfo reportInfo={reportInfo} disableStatus={disableStatus} onRef={(ref) => (this.tz = ref)}></TzReportInfo>
        )}
      </div>
    );
  }
}
export default ReportInfo;
